//
//  SHPhotoBrowser.h
//  Tradeaider
//
//  Created by 王方伟 on 2017/7/12.
//  Copyright © 2017年 Shinyhub. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PhotoBrowserConfig.h"
@class SHPhotoBrowser, FWGroupModel;

@protocol PhotoBrowserDelegate <NSObject>
- (NSArray<FWGroupModel *> *)photoBrowserDataSource:(SHPhotoBrowser *)photoBrowser;
/** 实现本方法以返回图片数量 */
@required
- (NSInteger)numberOfPhotos:(SHPhotoBrowser *)photoBrowser;
/** 站位图片 */
- (UIImage *)photoBrowser:(SHPhotoBrowser *)photoBrowser index:(NSInteger)index;
//- (void)photoBrowser:(SHPhotoBrowser *)photoBrowser index:(NSInteger)index imageBlock:(void(^)(UIImage *image))imageBlock;
/** 默认图片所在的View */
- (UIView *)photoBrowser:(SHPhotoBrowser *)photoBrowser showViewIndex:(NSInteger)index;
/** 图片地址 */
@optional
- (NSURL *)photoBrowser:(SHPhotoBrowser *)photoBrowser highQualityUrlIndex:(NSInteger)index;
/** 高清图片地址 */
@optional
- (NSURL *)photoBrowser:(SHPhotoBrowser *)photoBrowser originalQualityUrlIndex:(NSInteger)index;

/** 长按时回调 */
@optional
- (void)photoBrowser:(SHPhotoBrowser *)photoBrowser didLongPressIndex:(NSInteger)index image:(UIImage *)image;

/** 查看更多图片 */
@optional
- (void)onTouchMore:(SHPhotoBrowser *)photoBrowser;


@end

@interface SHPhotoBrowser : UIViewController
@property (assign, nonatomic) CGFloat photoSpacing;

+ (void)show:(UIViewController *)presentingVC delegate:(id <PhotoBrowserDelegate>)delegate index:(NSInteger)index configBlock:(void(^)(PhotoBrowserConfig *config))configBlock;
@end
